<?php

/**
 * SocialEngine
 *
 * @category   Application_Core
 * @package    Activity
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 * @version    $Id: NotificationsController.php 9204 2011-08-24 22:38:11Z john $
 * @author     John
 */

/**
 * @category   Application_Core
 * @package    Activity
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 */
class Visits_NotificationsController extends Core_Controller_Action_Standard
{

  public function init()
  {
    $this->_helper->requireUser();
  }
  
  public function indexAction()
  {
   echo "bbb";     
   
    // Force rendering now
    $this->_helper->viewRenderer->postDispatch();
    $this->_helper->viewRenderer->setNoRender(true);
   
  }

  public function updateAction()
  {
      $viewer = Engine_Api::_()->user()->getViewer(); 

    $this->view->notifications = $notifications = Engine_Api::_()->getDbtable('visits', 'visits')->getNotifications($viewer);
    $total = $notifications->getTotalItemCount();
    if($total == 0)
        $this->_helper->viewRenderer->setNoRender(true);
    
       // print_r($paginator);

    // Force rendering now
    //$this->_helper->viewRenderer->postDispatch();
    
      
  }
  
 


}